package mappkg

// https://leetcode-cn.com/problems/contains-duplicate/submissions/
// https://leetcode-cn.com/problems/contains-duplicate/
// 是否有重复元素
// 数据结构: map
func ContainsDuplicate(nums []int) bool {
	recordMap := make(map[int]int)
	for _, currentNum := range nums {
		recordMap[currentNum]++
	}
	for _, recordCount := range recordMap {
		if recordCount > 1 {
			return true
		}
	}
	return false
}
